// 导入 express
const express = require('express')
// 创建路由对象 
const router = express.Router()

// 导入验证数据的中间件
const expressJoi = require('../middleware/express-joi')

// 导入订单的路由处理函数模块
const order_handler = require('../router_handler/order')
// 1. 获取order用户的列表数据 
router.post('/list', order_handler.getorderLists)

// 导入订单的验证模块
const { add_order_schema } = require('../schema/order')
// 2. 新增订单的路由
router.post('/add', expressJoi(add_order_schema), order_handler.addorderLists)

// 导入删除分类的验证规则对象
const { delete_order_schema } = require('../schema/order')
// 3. 删除订单的路由
router.get('/delete/:order_id', expressJoi(delete_order_schema), order_handler.deleteorderById)

// // 导入更新订单的验证规则对象
// const { update_order_schema } = require('../schema/order')
// // 5. 更新订单的路由
// router.post('/update', expressJoi(update_order_schema), order_handler.updateorderById)

// 向外共享路由对象
module.exports = router